﻿<dx:DXWindow
    x:Class="WpfApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:WpfApp"
	xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
	xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
	xmlns:dxd="http://schemas.devexpress.com/winfx/2008/xaml/docking"
	xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
	xmlns:dxnb="http://schemas.devexpress.com/winfx/2008/xaml/navbar"
	xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
	xmlns:collections="clr-namespace:System.Collections;assembly=mscorlib"
    Title="Паспорта качества" Height="700" Width="1100"
    SnapsToDevicePixels="True" UseLayoutRounding="True"
    dx:ThemeManager.ThemeName="Office2007Blue"
    xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/core" 
    dxc:DXSplashScreen.SplashScreenType="{x:Type local:SplashScreenWindowMain}" 
    xmlns:dataprovider="clr-namespace:WpfApp.DataProvider"
    WindowStartupLocation="CenterScreen" 
    Icon="/WpfApp;component/Images/Icons/qp.ico">
    
    <Window.Resources>
        <!-- Создаем экземпляр нашего класса DataProvider -->
        <ObjectDataProvider x:Key="BatchesFullDataProvider" ObjectType="{x:Type dataprovider:BatchesFullDataProvider}"/>
        <!-- определяем метод который вызывается для получения данных о сотрудниках -->
        <ObjectDataProvider x:Key="BatchesFull" ObjectInstance="{StaticResource BatchesFullDataProvider}" MethodName="GetBatchesFull"/>
    </Window.Resources>

    <dxb:BarManager x:Name="barManager" CreateStandardLayout="True">
        <dxb:BarManager.Categories>
            <dxb:BarManagerCategory x:Name="File" />
            <dxb:BarManagerCategory x:Name="Edit" />
            <dxb:BarManagerCategory x:Name="Help" />
            <dxb:BarManagerCategory x:Name="BuiltIn" />
        </dxb:BarManager.Categories>
        <dxb:BarManager.Items>
            <dxb:BarButtonItem x:Name="bNew" CategoryName="File" Content="New" Glyph="Images/Icons/new-16x16.png" KeyGesture="Ctrl+N" Hint="New Blank Document"/>
            <dxb:BarButtonItem x:Name="bOpen" CategoryName="File" Content="Open" Glyph="Images/Icons/open-16x16.png" KeyGesture="Ctrl+O" Hint="Open"/>
            <dxb:BarButtonItem x:Name="bClose" CategoryName="File" Content="Close" Glyph="Images/Icons/close-16x16.png" Hint="Close"/>
            <dxb:BarButtonItem x:Name="bSave" CategoryName="File" Content="Save" Glyph="Images/Icons/save-16x16.png" KeyGesture="Ctrl+S" Hint="Save Document"/>
            <dxb:BarButtonItem x:Name="bSaveAs" CategoryName="File" Content="Save As..." Glyph="Images/Icons/save-as-16x16.png" Hint="Save Document As..."/>
            <dxb:BarButtonItem x:Name="bPrint" CategoryName="File" Content="Print" Glyph="Images/Icons/print-16x16.png" KeyGesture="Ctrl+P"/>
            <dxb:BarButtonItem x:Name="bExit" CategoryName="File" Content="Exit" KeyGesture="Ctrl+X"/>

            <dxb:BarButtonItem x:Name="bHome" CategoryName="Help" Content="Developer Express on the Web"/>
            <dxb:BarButtonItem x:Name="bAbout" CategoryName="Help" Content="About"/>

            <dxb:BarSubItem x:Name="smFile" CategoryName="BuiltIn" Content="Файл">
                <dxb:BarSubItem.ItemLinks>
                    <dxb:BarButtonItemLink BarItemName="bNew"/>
                    <dxb:BarButtonItemLink BarItemName="bOpen"/>
                    <dxb:BarButtonItemLink BarItemName="bClose"/>
                    <dxb:BarItemLinkSeparator/>
                    <dxb:BarButtonItemLink BarItemName="bSave"/>
                    <dxb:BarButtonItemLink BarItemName="bSaveAs"/>
                    <dxb:BarItemLinkSeparator/>
                    <dxb:BarButtonItemLink BarItemName="bPrint"/>
                    <dxb:BarItemLinkSeparator/>
                    <dxb:BarButtonItemLink BarItemName="bExit"/>
                </dxb:BarSubItem.ItemLinks>
            </dxb:BarSubItem>
            <dxb:BarSubItem x:Name="smEdit" CategoryName="BuiltIn" Content="Правка">
                <dxb:BarSubItem.ItemLinks>
                </dxb:BarSubItem.ItemLinks>
            </dxb:BarSubItem>
            <dxb:BarSubItem x:Name="smView" CategoryName="BuiltIn" Content="Вид">
                <dxb:BarSubItem.ItemLinks>
                </dxb:BarSubItem.ItemLinks>
            </dxb:BarSubItem>
            <dxb:BarSubItem x:Name="smHelp" CategoryName="BuiltIn" Content="Справка">
                <dxb:BarSubItem.ItemLinks>
                    <dxb:BarButtonItemLink BarItemName="bHome"/>
                    <dxb:BarItemLinkSeparator/>
                    <dxb:BarButtonItemLink BarItemName="bAbout"/>
                </dxb:BarSubItem.ItemLinks>
            </dxb:BarSubItem>
        </dxb:BarManager.Items>
        <dxb:BarManager.Bars>
            <dxb:Bar Caption="MainMenu" x:Name="MainMenu" IsMainMenu="True" UseWholeRow="True">
                <dxb:Bar.DockInfo>
                    <dxb:BarDockInfo ContainerType="Top"/>
                </dxb:Bar.DockInfo>
                <dxb:Bar.ItemLinks>
                    <dxb:BarSubItemLink BarItemName="smFile"/>
                    <dxb:BarSubItemLink BarItemName="smEdit"/>
                    <dxb:BarSubItemLink BarItemName="smView"/>
                    <dxb:BarSubItemLink BarItemName="smHelp"/>
                </dxb:Bar.ItemLinks>
            </dxb:Bar>
        </dxb:BarManager.Bars>
        <dxd:DockLayoutManager x:Name="dockLayoutManagerMain">
            <dxd:LayoutGroup>
                <dxd:LayoutGroup Orientation="Vertical"  ItemWidth="3*">
                    <dxd:DocumentGroup x:Name="documentGroupMain" ItemHeight="3*" SelectedTabIndex="0" >
                        <dxd:DocumentPanel x:Name="panelBatches" Caption="Партии" ItemHeight="3*" >
                            <dxg:GridControl DataContext="{Binding Source={StaticResource BatchesFull}}" ItemsSource="{Binding}" x:Name="gridControlBatchesFull" AutoPopulateColumns="True" ShowBorder="False" >
                                <!--<dxg:GridControl x:Name="gridControlBatchesFull" AutoPopulateColumns="True" ShowBorder="False" ColumnsPopulated="gridControlBatchesFull_ColumnsPopulated">-->
                                <dxg:GridControl.Columns>
                                    <dxg:GridColumn FieldName="ID" Visible="False" />
                                    <dxg:GridColumn FieldName="Дата изготовления" />
                                    <dxg:GridColumn FieldName="Номер партии" />
                                    <dxg:GridColumn FieldName="Наименование продукции" >
                                        <dxg:GridColumn.EditSettings>
                                            <dxe:ComboBoxEditSettings ValueMember="Наименование продукции" DisplayMember="Наименование продукции" ItemsSource="{Binding}" IsTextEditable="False" />
                                        </dxg:GridColumn.EditSettings>
                                    </dxg:GridColumn>
                                    <dxg:GridColumn FieldName="Упаковка" >
                                    <dxg:GridColumn.EditSettings>
                                            <dxe:ComboBoxEditSettings ValueMember="Упаковка" DisplayMember="Упаковка" ItemsSource="{Binding}" IsTextEditable="False" />
                                    </dxg:GridColumn.EditSettings>
                                    </dxg:GridColumn>
                                    <dxg:GridColumn FieldName="Количество" />
                                    <dxg:GridColumn FieldName="Единица измерения" >
                                    <dxg:GridColumn.EditSettings>
                                            <dxe:ComboBoxEditSettings ValueMember="Единица измерения" DisplayMember="Единица измерения" ItemsSource="{Binding}" IsTextEditable="False" />
                                    </dxg:GridColumn.EditSettings>
                                    </dxg:GridColumn>
                                    <dxg:GridColumn FieldName="Мастер" >
                                    <dxg:GridColumn.EditSettings>
                                            <dxe:ComboBoxEditSettings ValueMember="Мастер" DisplayMember="Мастер" ItemsSource="{Binding}" IsTextEditable="False" />
                                    </dxg:GridColumn.EditSettings>
                                    </dxg:GridColumn>
                                    <dxg:GridColumn FieldName="Вид продукции" >
                                    <dxg:GridColumn.EditSettings>
                                            <dxe:ComboBoxEditSettings ValueMember="Вид продукции" DisplayMember="Вид продукции" ItemsSource="{Binding}" IsTextEditable="False" />
                                    </dxg:GridColumn.EditSettings>
                                    </dxg:GridColumn>
                                </dxg:GridControl.Columns>
                                <dxg:GridControl.View>
                                    <dxg:TableView x:Name="tableBatchesFull" ShowAutoFilterRow="True" ShowTotalSummary="False" BestFitMode="VisibleRows" AllowBestFit="True" BestFitArea="Rows" AutoWidth="True" AllowEditing="False" NavigationStyle="Row" VerticalScrollbarVisibility="Auto" />
                                </dxg:GridControl.View>
                            </dxg:GridControl>
                        </dxd:DocumentPanel>
                    </dxd:DocumentGroup>
                    <dxd:LayoutPanel Caption="DetailView" ItemHeight="1*">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="0" />
                            </Grid.ColumnDefinitions>
                            <TextBox BorderThickness="0" />
                        </Grid>
                    </dxd:LayoutPanel>
                </dxd:LayoutGroup>
                <dxd:TabbedGroup ItemWidth="*">
                    <dxd:LayoutPanel Caption="Панель управления" >
                        <dxnb:NavBarControl x:Name="navBarControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <dxnb:NavBarControl.Groups>
                                <dxnb:NavBarGroup Header="Меню" x:Name="navBarGroupMenu" ImageSource="Images/Icons/Group.png">
                                    <dxnb:NavBarItem Content="Новая партия" x:Name="navBarItemAdd" ImageSource="Images/Icons/Item.png" Click="navBarItemAdd_Click" />
                                    <dxnb:NavBarItem Content="Изменить" x:Name="navBarItemChange" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Просмотр" x:Name="navBarItemView" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Удалить" x:Name="navBarItemDelete" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Печать" x:Name="navBarItemPrint" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Пакетная печать" x:Name="navBarItemPrintAll" ImageSource="Images/Icons/Item.png"/>
                                </dxnb:NavBarGroup>
                                <dxnb:NavBarGroup Header="Справочники" x:Name="navBarGroup2" ImageSource="Images/Icons/Group.png">
                                    <dxnb:NavBarItem Content="Сотрудники" x:Name="navBarItemEmployees" ImageSource="Images/Icons/Item.png" Click="navBarItemEmployees_Click" />
                                    <dxnb:NavBarItem Content="Производители" x:Name="navBarItemManufacturers" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Виды показателей" x:Name="navBarItemTypeOfParameter" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Виды упаковки" x:Name="navBarItemPackaging" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Виды продукции" x:Name="navBarItemTypeOfProduct" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Продукция" x:Name="navBarItemProducts" ImageSource="Images/Icons/Item.png"/>
                                </dxnb:NavBarGroup>
                                <!--<dxnb:NavBarGroup x:Name="navBarGroup3" ImageSource="Images/Icons/Group.png" IsVisible="False">
                                    <dxnb:NavBarItem Content="Копировать строку" x:Name="navBarItemRowCopy" ImageSource="Images/Icons/Item.png" />
                                    <dxnb:NavBarItem Content="Вырезать строку" x:Name="navBarItemRowCut" ImageSource="Images/Icons/Item.png" />
                                    <dxnb:NavBarItem Content="Вставить строку" x:Name="navBarItemRowPaste" ImageSource="Images/Icons/Item.png" />
                                    <dxnb:NavBarItem Content="Удалить строку" x:Name="navBarItemRowDelete" ImageSource="Images/Icons/Item.png" />
                                    <dxnb:NavBarItem Content="Сохранить изменения" x:Name="navBarItemSaveChanges" ImageSource="Images/Icons/Item.png" />
                                </dxnb:NavBarGroup>-->
                            </dxnb:NavBarControl.Groups>
                            <dxnb:NavBarControl.View>
                                <dxnb:ExplorerBarView/>
                            </dxnb:NavBarControl.View>
                        </dxnb:NavBarControl>
                        </dxd:LayoutPanel>
                        <!--<dxd:LayoutPanel Caption="Explorer" />-->
                </dxd:TabbedGroup>
            </dxd:LayoutGroup>
            <!--<dxd:DockLayoutManager.AutoHideGroups>
                <dxd:AutoHideGroup >
                    <dxd:LayoutPanel Caption="Navigation" ItemWidth="200" Padding="1">
                        <dxnb:NavBarControl Name="navBarControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <dxnb:NavBarControl.Groups>
                                <dxnb:NavBarGroup Header="Group1" ImageSource="Images/Icons/Group.png">
                                    <dxnb:NavBarItem Content="Item1" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Item2" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Item3" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Item4" ImageSource="Images/Icons/Item.png"/>
                                </dxnb:NavBarGroup>
                                <dxnb:NavBarGroup Header="Group2" ImageSource="Images/Icons/Group.png">
                                    <dxnb:NavBarItem Content="Item1" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Item2" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Item3" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Item4" ImageSource="Images/Icons/Item.png"/>
                                    <dxnb:NavBarItem Content="Item5" ImageSource="Images/Icons/Item.png"/>
                                </dxnb:NavBarGroup>
                            </dxnb:NavBarControl.Groups>
                            <dxnb:NavBarControl.View>
                                <dxnb:ExplorerBarView/>
                            </dxnb:NavBarControl.View>
                        </dxnb:NavBarControl> 
                    </dxd:LayoutPanel>
                    <dxd:LayoutPanel Caption="Tools"/>
                </dxd:AutoHideGroup>
            </dxd:DockLayoutManager.AutoHideGroups> -->
        </dxd:DockLayoutManager>
    </dxb:BarManager>

</dx:DXWindow>